home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / bbox.lwm < prev    next >
Text File  |  1993-12-13  |  874b  |  34 lines

  1. /* CMD: Bounding Box
  2.  * Display Bounding Box info, optionally create box for standin Obj.  */
  3. /* By Arnie Cachelin © 1993 NewTek Inc. */
  4.  
  5. libadd = addlib("LWModelerARexx.port",0)
  6. signal on error
  7. signal on syntax
  8. CurLay=curlayer()
  9. box=boundingbox()  /* Should check out empty list ...  */
  10. parse var box n x1 x2 y1 y2 z1 z2
  11. cx=(x2+x1)/2
  12. cy=(y2+y1)/2
  13. cz=(z2+z1)/2
  14. s1="!Layer "CurLay": " n" Points"
  15. s2="!Object Bounds"
  16. s3='@'x1 y1 z1
  17. s4='@'x2 y2 z2
  18. s5='@Center 'cx cy cz
  19.  
  20. if notify(2,s1,s5,s2,s3,s4,'!Create Bounding Box?',"(UNDO to remove Original Object)") then do
  21.  /* Cut and Paste so that 'undo' will remove object, leave box */
  22.   call CUT()
  23.   call MAKEBOX(x1 y1 z1,x2 y2 z2)
  24.   call PASTE()
  25.   end
  26. if (libadd) then call remlib("LWModelerARexx.port")
  27. exit
  28.  
  29. syntax:
  30. error:
  31.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  32.     if (libadd) then call remlib(mxx)
  33.     exit
  34.